s<?php
$func = new ProductRepository();
$cur = 1;
if (isset($_GET['page'])) {
    if (is_numeric($_GET['page']))
        $cur = $_GET['page'];
}
$totalItem = 0;
$perPageItem = 9;
$list = $func->GetTop9Product();
?>
<div id="right">
    <div class="box_content_t"></div>
    <div class="box_content_m">
        <table border="0" width="100%" cellspacing="0" cellpadding="0"  class="cont_heading_table">
            <tr>
                <td><img src="../content/images/cont_heading_tl.gif" border="0" alt="" width="10" height="10" /></td>
                <td  width="100%" class="cont_heading_t"><img src="../Content/images/spacer.gif" border="0" alt="" width="1" height="1" /></td>
                <td><img src="../content/images/cont_heading_tr.gif" border="0" alt="" width="10" height="10" /></td>
            </tr>

            <tr>
                <td  class="cont_heading_l"><img src="../content/images/spacer.gif" border="0" alt="" width="1" height="1" /></td>
                <td  class="cont_heading_td"><a href="../Views/Index.php">HOME</a></td>
                <td  class="cont_heading_r"><img src="../content/images/spacer.gif" border="0" alt="" width="1" height="1" /></td>
            </tr>
            <tr>
                <td><img src="../content/images/cont_heading_bl.gif" border="0" alt="" width="10" height="10" /></td>
                <td  class="cont_heading_b"><img src="../content/images/spacer.gif" border="0" alt="" width="1" height="1" /></td>

                <td><img src="../content/images/cont_heading_br.gif" border="0" alt="" width="10" height="10" /></td>
            </tr>
        </table>
        <div class="productContent">
            <div class="loading"></div>
            <table id='tblProducts' >
<?php
$count = 0;
while ($count < count($list)) {
?>
                <tr class='productsRow'>
<?php
    for ($i = $count; $i < count($list); $i++) {
?>
                    <td style="padding:20px 10px 0 10px;float:left;width:206px;height:260px;text-align:center;">
                        <div><a class="link1" href="#"><?php echo $list[$i]->Name_s ?></a></div>
                        <div class="clearall" style="margin-top:10px;"></div>
                        <div style="width:207px; text-align:center; border:1px solid #ebeaea; padding:5px 0 5px 0;">
                            <a href="../views/detail.php?id=<?php echo $list[$i]->Code_s; ?>"><img class="product1" alt="" src="../content/images/Products/<?php echo $list[$i]->Code_s; ?>/<?php $spilit = explode('|', $list[$i]->ImageSrc_s);
                    echo $spilit[0]; ?>"/></a>
                        </div>
                        <div class="clearall" style="margin-top:10px;"></div>
                        <div style="float:left; width:167px; padding:0 20px 0 20px;">
                            <table cellpadding="0" cellspacing="0" border="0" class="cont_body_table_2" style="float:left; width:97px;">
                                <tr>
                                    <td><img src="../content/images/cont_body_corn_tl_2.gif" border="0" alt="" width="10" height="10" /></td>
                                    <td width="100%" class="cont_body_tall_t_2"><img src="../../Content/images/spacer.gif" border="0" alt="" width="1" height="1" /></td>
                                    <td><img src="../content/images/cont_body_corn_tr_2.gif" border="0" alt="" width="10" height="10" /></td>
                                </tr>
                                <tr>

                                    <td class="cont_body_tall_l_2"><img src="../content/images/spacer.gif" border="0" alt="" width="1" height="1" /></td>
                                    <td width="100%" class="cont_body_td_2"><span class="productSpecialPrice"><?php echo $list[$i]->Price_f ?><br />VNĐ</span></td>
                                    <td class="cont_body_tall_r_2"><img src="../content/images/spacer.gif" border="0" alt="" width="1" height="1" /></td>
                                </tr>
                                <tr>
                                    <td><img src="../content/images/cont_body_corn_bl_2.gif" border="0" alt="" width="10" height="10" /></td>
                                    <td width="100%" class="cont_body_tall_b_2"><img src="../content/images/spacer.gif" border="0" alt="" width="1" height="1" /></td>
                                    <td><img src="../content/images/cont_body_corn_br_2.gif" border="0" alt="" width="10" height="10" /></td>
                                </tr>
                            </table>
                            <div style="float:left; width:55px; margin:0 0 0 15px;">
                                <a href="../views/detail.php?id=<?php echo $list[$i]->Code_s; ?>">
                                    <div class="detail">
                                        Chi tiết
                                    </div>
                                </a>
                                <div class="clearall"></div>
                               <a href="../views/Cart.php?id=<?php echo $list[$i]->Code_s; ?>">
                                <div class="addToCart" style="margin:5px 0 0 0; cursor:pointer;">
                                    Mua
                                </div>
                                </a>
                            </div>
                        </div>
                    </td>
                    <?php
                    if (++$count % 3 == 0)
                        break;
                }
                    ?>
                </tr>
                <?php
            }
                ?>

            </table>
        </div>
        <!-- END DEFINE YOUR CONTENT HERE -->
    </div>
    <div class="box_content_b"></div>
</div>